import React from "react";
import {Redirect} from "react-router";

export function Auth(C,authed,authPath,needAuth,i) {
    if(!authed && needAuth){
        return <Redirect to={authPath} key={i}/>
    }else{
        return C
    }
}